﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using System.IO;
using System.Drawing;
using System.Data;

namespace WLWeb.Common
{
    public partial class GetPic : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["picid"] != null && Request.QueryString["picid"].ToString() != "")
            {
                string where = " WebExampleID='" + Request.QueryString["picid"].ToString() + "' and Disabled=0 and Sort=1";
                WLong.BLL.Rel_WebPicture webpic = new WLong.BLL.Rel_WebPicture();
                string picSrc = "";
                DataSet ds = webpic.GetList(where);
                if (ds != null && ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
                {
                    DataTable dtpic = ds.Tables[0];
                    if (!string.IsNullOrEmpty(dtpic.Rows[0]["BinaryData"].ToString()))
                    {
                        byte[] buf = (byte[])dtpic.Rows[0]["BinaryData"];
                        Response.BinaryWrite(buf);
                        Response.End();
                    }
                }
            }
        }
    }
}